#ifndef DIARY_H
#define DIARY_H

#include<iostream>
#include<string>
#include"Meeting.h"
#include"Day.h"
#include"MeetingFactory.h"

using namespace std;

class Diary{
public:

	static void Destroy()
	{
		delete diaryPtr; diaryPtr = 0;
	} 
	static Diary* createObj() 
	{ 
		if (diaryPtr == 0)	
		{
			diaryPtr = new Diary;
		} 
		return diaryPtr;
	}

	// add meeting to diary (return 1 if succeeded,0 otherwise)
	virtual int addMeetingToDiary(const string& what,const vector<string>& prtcp,const string& sbj,const string& day,int sH,int sM,int eH,int eM);

	//delete meeting from diary
	virtual void deleteMeetingFromDiary(Meeting* meet);

    //find meeting in the diary in specific day that start in specific time 
	 virtual Meeting* findMeetingInDiary(const string& weekDay , int startHour, int startMinute)const;

	//change time of meeting
	virtual void changeMeetingTime(Meeting* meet,const string& weekDay ,int newstartHour, int newstartMinute, int newendHour, int newendMinute);

	// print out Diary data
	virtual void printOut()const;

	//getter for vector of days
	virtual const vector<Day*>& getVec()const;


protected:

	// DTOR
	virtual  ~Diary();


	//chek if vector of participators is correct - all from list and no two with same name
	virtual bool checkPrt(const vector<string>& prtcp)const;

	//check if the day is correct - not Friday or Saturday
	virtual bool checkDay(const string& day)const;

	//check if time is correct - start before end , end in the same day it's start, Hour<24, Minute<60
	virtual bool checkTime(int sH,int sM,int eH,int eM)const;

	//get string day return the day number 
	virtual int findNumberOfDay(const string& day)const;

	//find which day is the larger and return is size
	virtual int findMaxVec()const;

	static const string participators[10];  //Diary participators
	static const string weekDays[7];        //Days of week
	vector<Day*> vectorOfDays;              // vec of days


private:

	// default CTOR
	Diary();
	Diary(const Diary&);		// no  copy 
	void operator=(Diary&);		// no copy 


	static Diary* diaryPtr; 



}; 

#endif
